AbstractComboBox = function(config) {

    Ext.apply(this, {
        plugins: [Ext.ux.ComboListAutoSizer],
        mode : 'remote',
        valueField : 'name',
        displayField : 'name',
        loadingText : 'Dohvat...',
        hideTrigger : false,
        triggerAction : 'all',
        msgTarget: 'side',
        minChars : 3,
        typeAhead : true,
        forceSelection : true,
        hideLabel : false,
        emptyText : '- Odaberite -'
     });

    AbstractComboBox.superclass.constructor.apply(this, [config]);

    this.on('beforedestroy', function(combo) {
       combo.purgeListeners();
       combo.store.purgeListeners();
    });



};

Ext.extend(AbstractComboBox, Ext.form.ComboBox, {
    setValue : function(v){
        this.superclass().setValue.call(this, v);
        if (this.disabled) {
            var parent = this.el.dom.parentNode;
            var el = Ext.get(parent);
            new Ext.ToolTip({
                target: el.id,
                html : v,
                anchor: 'top'
            });
        }

    }
});

Ext.reg('abstractComboBox', AbstractComboBox);
